<% javascript 'dynamic_farms' %>

<h1>New product</h1>
  <% form_for(@product) do |product| %>
  <%= product.error_messages %>
  <p>
    <%= product.label :product_type  %>: 
    <%= product.collection_select :product_type, @saletype, :Code, :Name %>
  </p>
  
  <div id ="price">
    <%= render :partial => 'price', :collection => @product.prices %>
  </div>
  <%= add_price_link "Add more bags" %>
  
  <div id="productorigin">
    <%= render :partial => 'productorigin', :collection => @product.productorigins %>
  </div>
  <%= add_productorigin_link "Add a productorigin" %>
  

   <p>
	<label for ="product_name"> Product Name: </label>
    <%= product.text_field :name %>
  </p>
  <p>
    <%= product.label :desc1 %><br />
    <%= product.text_area :desc1 %>
  </p>
  <p>
    <%= product.label :desc2 %><br />
    <%= product.text_area :desc2 %>
  </p>
  <p>
    <%= product.label :body %><br />
    <%= product.text_field :body %>
  </p>
  <p>
    <%= product.label :acidity %><br />
    <%= product.text_field :acidity %>
  </p>
  <p>
    <%= product.label :product_yrs %><br />
    <%= product.text_field :product_yrs %>
  </p>

  <p>
    <%= product.submit 'Create' %>
  </p>
<% end %>
 

<%= link_to 'Back', products_path %>

